import Api from "/@/api/Api";

import ApiConfig from "/@/api/ApiConfig";
import {UnwrapRef} from "vue";

export default class DeptApi extends Api {

    static getList(params: UnwrapRef<SysDeptTableType["param"]>) {
        return this.get({
            url: ApiConfig.SYSTEM.DEPT_LIST,
            params: params
        });
    }


    static insert(dept: RowDeptType) {
        return this.post({
            url: ApiConfig.SYSTEM.DEPT,
            data: dept,
        });
    }

    static update(dept: RowDeptType) {
        return this.put({
            url: ApiConfig.SYSTEM.DEPT,
            data: dept
        });
    }

    static view(id: string) {
        return this.get({
            url: ApiConfig.SYSTEM.DEPT,
            params: {id: id}
        });
    }

    static remove(ids: string) {
        return this.delete({
            url: ApiConfig.SYSTEM.DEPT,
            params: {ids: ids}
        });
    }

    static getDeptTree() {
        return this.get({
            url: ApiConfig.SYSTEM.DEPT_TREE,
        });
    }
}